#!/bin/sh
#desc:Access to cameras
FAKEPID="/var/run/odvision_access.pid"


case "$1" in
  start)
	echo -n "Enabling access to cameras ..."
  	echo "1" > $FAKEPID
	chown admin:admin $FAKEPID
	;;
  stop)
	echo -n "Disabling access to cameras ..."
  	rm $FAKEPID 2>/dev/null
	;;
  status)
  	if test -f $FAKEPID; then
  		echo "The service is running"
  		exit 0
  	else
  		echo "Service not started"
  		exit 1
  	fi
        ;;
  reload|restart)
	echo -n "Re-Enabling access to cameras ..."
	echo "1" > $FAKEPID
	chown admin:admin $FAKEPID
	;;
  *)
	echo $"Usage: $0 {start|stop|restart|status}"
	exit 1
esac

